home *** CD-ROM | disk | FTP | other *** search
- function firecarfun()
- {
- if(!pauseflag)
- {
- Shot1_Sound.start();
- this.gun.play();
- }
- }
- function loadcars()
- {
- this.frm = Math.round(Math.random() * 9);
- if(this.frm == 0)
- {
- this.frm = 9;
- }
- this.gotoAndStop(this.frm);
- if(this._name == "cars0")
- {
- this._yscale = -100;
- xx = 1;
- this.speedcars = Math.random() * 5 + 2;
- this._y = -25 - Math.random() * 375 * 5;
- }
- else
- {
- this._yscale = 100;
- this._y = -25 - Math.random() * 375 * 2;
- this.upflag = this._y;
- this.speedcars = Math.random() * 10 + 5;
- if(this._name == "cars1")
- {
- xx = 2;
- }
- if(this._name == "cars2")
- {
- xx = 3;
- }
- }
- this._x = 140 + 70 * xx;
- this.onEnterFrame = this._parent.movecars;
- this.onMouseDown = this._parent.onlinefire;
- }
- function movecars()
- {
- if(_root._currentframe > 17 || _root._currentframe < 12)
- {
- removeMovieClip(this);
- }
- if(this._y < this.upflag - 200)
- {
- this.onLoad();
- }
- if(!pauseflag)
- {
- if(this._y > 0)
- {
- this.upflag = 0;
- }
- if(this._yscale > 0)
- {
- this._y += speed - this.speedcars;
- }
- else
- {
- this._y += speed + this.speedcars;
- }
- if(this._y > 800)
- {
- this.onLoad();
- }
- if(this.hitTest(car.hit) && !trydead)
- {
- trydead = true;
- var _loc3_ = _root.getNextHighestDepth();
- _root.attachMovie("expl","expl" + String(_loc3_),_loc3_,{_x:this._x,_y:this._y});
- this._y = 1000;
- }
- }
- }
- function loadobstacles()
- {
- this.frm = Math.round(Math.random() * 9);
- if(this.frm == 0)
- {
- this.frm = 9;
- }
- this.gotoAndStop(this.frm);
- if(this.frm < 4)
- {
- xx = Math.round(Math.random() * 3);
- if(xx == 0)
- {
- xx = 3;
- }
- this._x = 140 + 70 * xx;
- this._y = -25 - Math.random() * 375 * 1;
- }
- else
- {
- xx = Math.round(Math.random() * 6);
- if(xx == 0)
- {
- xx = 6;
- }
- this._x = 160 + 35 * xx;
- this._y = -25 - Math.random() * 375 * 3;
- }
- this.onEnterFrame = this._parent.moveobstacles;
- this.onMouseDown = this._parent.onobstacleslinefire;
- }
- function onobstacleslinefire()
- {
- if(!pauseflag)
- {
- if(firecar > 0 && !fire && this._y > 0)
- {
- var _loc3_ = this._currentframe;
- if(_loc3_ == 2 || _loc3_ == 8)
- {
- if(this._x > car._x - 20 && this._x < car._x + 20)
- {
- fire = true;
- var _loc4_ = _root.getNextHighestDepth();
- var _loc5_ = _root.attachMovie("expl","expl" + String(_loc4_),_loc4_,{_x:this._x,_y:this._y});
- _loc5_.onEnterFrame = _root.moveobject;
- this.onLoad();
- }
- }
- }
- }
- }
- function moveobstacles()
- {
- if(_root._currentframe > 17 || _root._currentframe < 12)
- {
- removeMovieClip(this);
- }
- if(!pauseflag)
- {
- this._y += speed;
- if(this._y > 380)
- {
- this.onLoad();
- }
- if(this.hitTest(car.hit) && !trydead)
- {
- switch(this._currentframe)
- {
- case 1:
- case 9:
- water_Sound.start();
- undrive = 1;
- break;
- case 2:
- case 8:
- car_expl_Sound.start();
- if(speed > 15)
- {
- trydead = true;
- }
- else
- {
- speedverylow = 12;
- }
- var _loc3_ = _root.getNextHighestDepth();
- _root.attachMovie("expl","expl" + String(_loc3_),_loc3_,{_x:this._x,_y:this._y});
- this._y = 400;
- break;
- case 3:
- stopdrive = 120;
- break;
- case 4:
- case 7:
- speedlow = 12;
- break;
- case 5:
- rabbit_Sound.start();
- score -= 100;
- if(score < 0)
- {
- score = 0;
- }
- this._y = 400;
- break;
- case 6:
- stone_Sound.start();
- speedverylow = 12;
- }
- this.onEnterFrame = _root.moveusedobject;
- }
- }
- }
- function loadbonuses()
- {
- this.frm = Math.round(Math.random() * 7);
- if(this.frm == 6 and Math.random() * 10 > 2)
- {
- this.frm = Math.round(Math.random() * 7);
- }
- if(this.frm == 0)
- {
- this.frm = 7;
- }
- this.gotoAndStop(this.frm);
- xx = Math.round(Math.random() * 3);
- if(xx == 0)
- {
- xx = 3;
- }
- this._x = 140 + 70 * xx;
- this._y = -25 - Math.random() * 375 * 2;
- this.onEnterFrame = this._parent.movebonuses;
- this.onMouseDown = this._parent.onlinefire;
- }
- function movebonuses()
- {
- if(_root._currentframe > 17 || _root._currentframe < 12)
- {
- removeMovieClip(this);
- }
- if(!pauseflag)
- {
- this._y += speed;
- if(this._y > 380)
- {
- this.onLoad();
- }
- if(this.hitTest(car.hit))
- {
- switch(this._currentframe)
- {
- case 1:
- score_get_Sound.start();
- score += 10;
- break;
- case 2:
- score_get_Sound.start();
- score += 20;
- break;
- case 3:
- score_get_Sound.start();
- score += 50;
- break;
- case 4:
- score_get_Sound.start();
- score += 100;
- break;
- case 5:
- bonus_get_Sound.start();
- firecar = 120;
- car.gun._visible = true;
- car.onMouseDown = firecarfun;
- break;
- case 6:
- score_get_Sound.start();
- lives += 1;
- break;
- case 7:
- bonus_get_Sound.start();
- speedfast = 120;
- car.turbo._visible = true;
- }
- this._y = 400;
- }
- }
- }
- function onlinefire()
- {
- if(!pauseflag)
- {
- if(firecar > 0 && !fire && this._y > 0)
- {
- if(this._x > car._x - 20 && this._x < car._x + 20)
- {
- fire = true;
- var _loc3_ = _root.getNextHighestDepth();
- var _loc4_ = _root.attachMovie("expl","expl" + String(_loc3_),_loc3_,{_x:this._x,_y:this._y});
- _loc4_.onEnterFrame = _root.moveobject;
- this.onLoad();
- }
- }
- }
- }
- function moveusedobject()
- {
- if(_root._currentframe < 12)
- {
- removeMovieClip(this);
- }
- if(!pauseflag)
- {
- this._y += speed;
- if(this._y > 380)
- {
- this.onLoad();
- }
- }
- }
- function moveobject()
- {
- if(_root._currentframe < 12)
- {
- removeMovieClip(this);
- }
- if(!pauseflag)
- {
- this._y += speed;
- }
- }
- frameN = 1;
- land.onEnterFrame = function()
- {
- if(!pauseflag)
- {
- var _loc4_ = Math.round((315 - _root._ymouse) / 33 * 2);
- if(_loc4_ > 10)
- {
- _loc4_ = 10;
- }
- if(_loc4_ < 0)
- {
- _loc4_ = 0;
- }
- var _loc3_ = 1.2;
- if(car._x < 175)
- {
- _loc3_ = 0.9;
- }
- if(speedfast > 0)
- {
- speedfast -= 1;
- _loc3_ = 1.5;
- if(speedfast == 0)
- {
- car.turbo._visible = false;
- bonus_lost_Sound.start();
- }
- }
- if(speedlow > 0)
- {
- speedlow -= 1;
- _loc3_ = 0.9;
- }
- if(speedverylow > 0)
- {
- speedverylow -= 1;
- _loc3_ = 0.7;
- }
- if(stopdrive > 0)
- {
- stopdrive -= 1;
- _loc3_ = 0.7;
- }
- speed = _loc4_ * _loc3_ * 1.5;
- if(_root._currentframe > 14)
- {
- speed = 0;
- }
- _root.finishline._y += speed;
- var _loc6_ = Math.abs(_root.finishline._y - 350) / (numlevel * 375 * countscr + 350);
- _root.carsmall._y = 35 + 175 * _loc6_;
- var _loc5_ = 13.5;
- _root.pointer._rotation = speed * _loc5_;
- if(this._y + speed < 320)
- {
- this._y += speed;
- }
- else
- {
- this._y += speed - 320;
- }
- }
- if(playenergyflag)
- {
- playenergyflag = false;
- engine_Sound.start();
- }
- if(_root._currentframe > 17 || _root._currentframe < 12)
- {
- playenergyflag = true;
- engine_Sound.stop();
- delete this.onEnterFrame;
- }
- };
- engine_Sound.onSoundComplete = function()
- {
- playenergyflag = true;
- };
- car.onEnterFrame = function()
- {
- if(_root._currentframe > 17 || _root._currentframe < 12)
- {
- delete this.onEnterFrame;
- }
- if(_root._currentframe < 9 || _root._currentframe > 20)
- {
- removeMovieClip(this);
- }
- if(!pauseflag)
- {
- if(speed != 0)
- {
- var _loc3_ = 100 / speed;
- dx = this._xmouse / _loc3_;
- }
- else
- {
- dx = 0;
- }
- if(undrive > 0)
- {
- undrive -= 1;
- dx = Math.random() * 50 - 25;
- }
- if(firecar > 0)
- {
- firecar -= 1;
- if(firecar == 0)
- {
- car.gun._visible = false;
- bonus_lost_Sound.start();
- delete this.onMouseDown;
- }
- }
- if(this._x + dx < 365 && this._x + dx > 125)
- {
- this._x += dx;
- }
- }
- };
- bonuspanel.onEnterFrame = function()
- {
- if(!pauseflag)
- {
- frm = 1;
- if(firecar > 0)
- {
- if(stopdrive == 0 && speedfast == 0 || firecar < stopdrive && speedfast == 0 || stopdrive == 0 && firecar < speedfast)
- {
- frm = 2;
- }
- }
- if(speedfast > 0)
- {
- if(firecar == 0 && stopdrive == 0 || speedfast < stopdrive && firecar == 0 || stopdrive == 0 && speedfast < firecar)
- {
- frm = 3;
- }
- }
- if(stopdrive > 0)
- {
- if(firecar == 0 && speedfast == 0 || stopdrive < firecar && speedfast == 0 || firecar == 0 && stopdrive < speedfast)
- {
- frm = 4;
- }
- }
- switch(frm)
- {
- case 1:
- tx = 0;
- break;
- case 2:
- tx = Math.floor(firecar / 12);
- break;
- case 3:
- tx = Math.floor(speedfast / 12);
- break;
- case 4:
- tx = Math.floor(stopdrive / 12);
- }
- if(frm != this._currentframe)
- {
- this.gotoAndStop(frm);
- if(tx != 0)
- {
- bonustime = String(tx);
- }
- else
- {
- bonustime = "";
- }
- }
- if(tx != 0 && frameN % 12 == 0)
- {
- bonustime = String(tx);
- }
- if(_root._currentframe > 14 || _root._currentframe < 12)
- {
- stopdrive = 0;
- firecar = 0;
- speedfast = 0;
- speedlow = 0;
- speedverylow = 0;
- undrive = 0;
- this.gotoAndStop(1);
- bonustime = "";
- car.turbo._visible = false;
- car.gun._visible = false;
- delete this.onEnterFrame;
- }
- }
- };
- bonuses.onLoad = function()
- {
- var _loc4_ = 2;
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- var _loc3_ = bonuses.duplicateMovieClip("bonuses" + String(_loc2_),200 + _loc2_);
- _loc3_.onLoad = this._parent.loadbonuses;
- _loc2_ = _loc2_ + 1;
- }
- };
- obstacles.onLoad = function()
- {
- if(numlevel % 3 != 0)
- {
- var _loc4_ = numlevel + 1;
- if(numlevel > 5)
- {
- _loc4_ = 6;
- }
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- var _loc3_ = obstacles.duplicateMovieClip("obstacles" + String(_loc2_),100 + _loc2_);
- _loc3_.onLoad = this._parent.loadobstacles;
- _loc2_ = _loc2_ + 1;
- }
- }
- };
- cars.onLoad = function()
- {
- if(numlevel % 3 == 0)
- {
- var _loc4_ = 3;
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- var _loc3_ = cars.duplicateMovieClip("cars" + String(_loc2_),300 + _loc2_);
- _loc3_.onLoad = this._parent.loadcars;
- _loc2_ = _loc2_ + 1;
- }
- }
- };
-